@extends('layouts.app')
@section('title', config('seo_title').translate('登录'))

@section('footer')
     @include('common.footer')
@stop
@section('content')
<div class="container" id="container">
        <div class="wrapper">
            <div id="minHeight" class="minHeight">
                <div class="wrapper">
                   @include('common.header', ['title' => translate('登录')])
                    <div class="main_body">
                        <div class="login">
                        	<form class="form-horizontal" id="ll" method="POST" action="{{ route('login') }}">
                            <div id="login" name="login">
                            {{ csrf_field() }}
                                <div class="control-group">
                                    <input type="text" name="mobile" id="name" class="input-style1" placeholder="{{translate('用户名/手机号')}}" value="">
                                </div>
                                <div class="control-group">
                                    <input type="password" name="password" id="pwd" class="input-style1" placeholder="{{translate('请输入密码')}}">
                                </div>
                                <div class="control-group">
                                    <a is_click="1" id="submit" style="background:#ee4b02" onclick="go_login($(this))" class="btn-style1">{{translate('登录')}}</a>
                               <!--onclick="go_login($(this))"-->
                                </div>
                            </div>
                            </form>
                            <div class="clearfix" style="padding:12px;">
                                <span class="fl"><a href="{{ route('password.request') }}" class="freereg">{{translate('找回登录密码')}}</a></span>
                                <a href="/register" class="fr forget">{{translate('免费注册')}}</a>
                            </div>
                        </div>
                    </div>
                </div>
                <link href="/fontpage/css/select_city.3.3.4.css" rel="stylesheet">
                <script type="text/javascript">
                    var confirm = 0;
                    var isSending = 1;
                    function go_login(that) {

                        if (that.attr("is_click") == 0) {
                            return;
                        }

                        if (isSending > 1) /*防止重复点击*/ {
                            return false;
                        }
                        var _self = that;
                        var name = $.trim($("#name").val());
                        var pwd = $.trim($("#pwd").val());
                        //var bind = $.trim($("#bind:checked").val());
                        if (name != '' && pwd != '') {
                            if (pwd.length < 6 || pwd.length > 16) {
                                $.prompt("{{translate('密码长度为6-16位')}}", {
                                    buttons: { "{{translate('确定')}}": true }
                                });
                            }
                            else {
                            	$('#ll').submit();
                            }
                        } else {
                            $.prompt("{{translate('请将用户名和密码填写完整')}}", {
                                buttons: { "{{translate('确定')}}": true }
                            });
                        }
                    }
                    $(window).on('load', function () {
                        setTimeout(function () {
                            $("#submit").attr("is_click", "1");
                            $("#submit").css({ 'background': '#ee4b02' });
                            $("#submit").html("{{translate('登录')}}");
                        }, 100);
                    })
                </script>
            </div>
        </div>
    </div>

@endsection
